package org.example;

import org.cpplib.*;

import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.PointerByReference;

public class Main {
    public interface Dll2 extends Library{
        Dll2 instance = (Dll2)Native.loadLibrary("D://test//TestDLLQT", Dll2.class);
        int add(int a,int b);

        int schedule(FLIGHT_PLAN flight_plan, PLANE_INFO_LIST job);

//        public int substract(int a,int b);
//        public void printHello();
//        Pointer createObj();
//        PointerByReference createObj();
//        int Class_getValue(Pointer pointer);
//        int Class_getValue(PointerByReference，pointer);
//        Pointer MyClass_ctor();
    }

    public static void test1()
    {
//        int sum = Dll2.instance.add(6, 7);
//        System.out.println("add(5,3) = "+sum);
//        PointerByReference msg = Dll2.instance.createObj();
//        Pointer self = Dll2.instance.createObj();
//        System.out.println(Dll2.instance.Class_getValue(self));
//        System.out.println(Dll2.instance.Class_getValue(msg));
    }


    public static void main(String[] args) {

//        MyClass counter = new MyClass(3);
//        counter.increment();
//        counter.increment();
//        System.out.println(counter.getValue());
//        System.out.println((Dll2.instance.add(6, 7)));
//        String a = "a123";
//        byte b = counter.charTest(a);
//        System.out.println((char)(b));
//        Student s = new Student();
//        s.a = 30;
//        System.out.println(counter.structTest(s));
//        counter.printTest();


////
//        PLANE_INFO_LIST job = new PLANE_INFO_LIST();
//        FLIGHT_PLAN flight_plan = new FLIGHT_PLAN();
//        flight_plan.jobTasks[0].batch = 1;
////        int b=0;
//        System.out.println(Dll2.instance.schedule(flight_plan, job));


        PlanOptClassNew p1 = new PlanOptClassNew();
        p1.testAll();
    }

}